import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/Login'
  },
  {
    path: '/Login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/Home',
    name: 'Home',
    component: () => import('../views/Home.vue'),
    redirect: '/Index',
    children:[
      {
        path: '/Index',
        name: 'Index',
        component: () => import('../views/Index.vue')
      },
      {
        path: '/Inbook',
        name: 'Inbook',
        component: () => import('../views/Inbook.vue')
      },
      {
        path: '/Borrow',
        name: 'Borrow',
        component: () => import('../views/Borrow.vue')
      },
      {
        path: '/Admin',
        name: 'Admin',
        component: () => import('../views/Admin.vue')
      },
      
    ]
    
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
